package com.xjh.basestudy.designmode.structureMode.structureMode5_FlyWeight.p1_origin;

/**
 * @author XuJianHua
 * @date 2022-09-26 11:01:01
 * @description 图块绘制类
 * * 用户传入图片及图片绘制位置，程序可自动把图片绘制到相应位置上
 */
public class Tile {

    private String image;//图块所用的材质图
    private int x, y;//图块所在坐标

    public Tile(String image, int x, int y) {
        this.image = image;
        System.out.print("从磁盘加载[" + image + "]图片，耗时半秒……");
        this.x = x;
        this.y = y;
    }

    public void draw() {
        System.out.println("在位置[" + x + ":" + y + "]上绘制图片：[" + image + "]");
    }

}